<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libxlsxwriter: Working with Colors</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libxlsxwriter
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Working with Colors </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Throughout libxlsxwriter colors are specified using a Html style RGB integer value. For example with a Format object:</p>
<div class="fragment"><div class="line"><a class="code" href="format_8h.html#a61981b2080bfe6381ede5358ee05b05c">format_set_font_color</a>(format, 0x3030E0);</div>
</div><!-- fragment --><p>For convenience a limited number of color names are supported:</p>
<div class="fragment"><div class="line"><a class="code" href="format_8h.html#a61981b2080bfe6381ede5358ee05b05c">format_set_font_color</a>(format, <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>);</div>
</div><!-- fragment --><p>The color names and corresponding RRGGBB value are shown below:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Color  </th><th class="markdownTableHeadNone">Define  </th><th class="markdownTableHeadNone">Value   </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Black  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>  </td><td class="markdownTableBodyNone"><code>0x1000000</code> (note)   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Blue  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a>  </td><td class="markdownTableBodyNone"><code>0x0000FF</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Brown  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bac7d0a878a1d72bd2f17c50bc41af6bd0">LXW_COLOR_BROWN</a>  </td><td class="markdownTableBodyNone"><code>0x800000</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Cyan  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba1debfae936d05272324e9a7d1f092093">LXW_COLOR_CYAN</a>  </td><td class="markdownTableBodyNone"><code>0x00FFFF</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Gray  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba9d8f4d0a626d45d0f89fb4d404b592c0">LXW_COLOR_GRAY</a>  </td><td class="markdownTableBodyNone"><code>0x808080</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Green  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a>  </td><td class="markdownTableBodyNone"><code>0x008000</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Lime  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba159829f690cde36c2aa2ec3e1e4b79d1">LXW_COLOR_LIME</a>  </td><td class="markdownTableBodyNone"><code>0x00FF00</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Magenta  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba52330ab8ca0f60e106043cb340cedd73">LXW_COLOR_MAGENTA</a>  </td><td class="markdownTableBodyNone"><code>0xFF00FF</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Navy  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba5f9a9111c59f09167d9d79cc4750a7f3">LXW_COLOR_NAVY</a>  </td><td class="markdownTableBodyNone"><code>0x000080</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Orange  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba4d686a30e8e3b7d23dc6424f1f5bf679">LXW_COLOR_ORANGE</a>  </td><td class="markdownTableBodyNone"><code>0xFF6600</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Pink  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baba59ce674c5923f4987095897a4bfa69">LXW_COLOR_PINK</a>  </td><td class="markdownTableBodyNone"><code>0xFF00FF</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Purple  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba326d6f6b69afcd709e02aa17f72130ed">LXW_COLOR_PURPLE</a>  </td><td class="markdownTableBodyNone"><code>0x800080</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">Red  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>  </td><td class="markdownTableBodyNone"><code>0xFF0000</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Silver  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baf986b48f94200c9d4e7ee85013805e33">LXW_COLOR_SILVER</a>  </td><td class="markdownTableBodyNone"><code>0xC0C0C0</code>   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">White  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba77f6d9e520849cf6c25a7f33cf303da2">LXW_COLOR_WHITE</a>  </td><td class="markdownTableBodyNone"><code>0xFFFFFF</code>   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">Yellow  </td><td class="markdownTableBodyNone"><a class="el" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>  </td><td class="markdownTableBodyNone"><code>0xFFFF00</code>   </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>Black in Html is actually <code>0x000000</code> but <code>#LXW_COLOR_BLACK</code> is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct Html code internally.</dd></dl>
<p>Next: <a class="el" href="working_with_formulas.html">Working with Formulas</a> </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a></div><div class="ttdeci">@ LXW_COLOR_RED</div><div class="ttdef"><b>Definition:</b> format.h:217</div></div>
<div class="ttc" id="aformat_8h_html_a61981b2080bfe6381ede5358ee05b05c"><div class="ttname"><a href="format_8h.html#a61981b2080bfe6381ede5358ee05b05c">format_set_font_color</a></div><div class="ttdeci">void format_set_font_color(lxw_format *format, lxw_color_t color)</div><div class="ttdoc">Set the color of the font used in the cell.</div></div>
<!-- HTML footer for doxygen 1.8.20-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Copyright 2014-2020 John McNamara.
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
